<?php
	//1   6
	//empty判断内容是否为空
	if(!empty($_POST['age']))
	{
		if(preg_match('/^[1-6]\d$/', $_POST['age']))
		{
			echo 'success';
		}
	}
?>

<form method="post">
	
	<input type="text" name="age">
	<input type="submit">
	
</form>